import math
sum=0
for j in range(2,1000):
    flag=1
    a=j
    b=int(math.sqrt(a))
    for i in range(2,b+1):
        if(a%i==0):
            flag=0
            break
    if(flag==1):
        print("%d是素数,"%a)
        sum=sum+1
    else:
        print('%d不是素数,'%a)
print("\n一共有",sum,"个素数")
